<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>
            X-admin v1.0
        </title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="__PUBLIC__/admin/css/x-admin.css" media="all">
    </head>
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>订单管理</cite></a>
              <a><cite>订单试课</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
        </div>
        <div class="x-body">
            <!-- <xblock>
                <form method="post" action="{:U('admin/order/order_export','','')}" enctype="multipart/form-data">
                   <button type="submit" class="layui-btn layui-btn-mini">全部导出</button>
                </form>
            </xblock> -->
            <table class="layui-table">
                <thead>
                    <tr>
                        <th>
                            预约号
                        </th>
                        <th>
                            老师
                        </th>
                        <th>
                            老师性别
                        </th>
                        <th>
                            老师手机
                        </th>
                        <th>
                            家长
                        </th>
                        <th>
                            家长性别
                        </th>
                        <th>
                            家长手机
                        </th>
                        <th>
                            试课时间
                        </th>
                        <th>
                            年级
                        </th>
                        <th>
                            科目
                        </th>
                        <th>
                            上课地址
                        </th>
                        <th>
                            老师状态
                        </th>
                        <th>
                            操作
                        </th>
                    </tr>
                </thead>
                <tbody>
                <?php foreach ($order_shenhes as $u) { ?>
                    <tr>
                        <td>
                            {$u.id}
                        </td>
                        <td>
                            {$u.ls_name}
                        </td>
                        <td >
                            {$u.ls_sex}
                        </td>
                        <td >
                            {$u.ls_phone}
                        </td>
                        <th>
                            {$u.jz_name}
                        </th>
                        <th>
                            {$u.jz_sex}
                        </th>
                        <th>
                            {$u.jz_phone}
                        </th>
                        <th>
                            {$u.date}{$u.time}
                        </th>
                        <th>
                            {$u.grade}
                        </th>
                        <th>
                            {$u.subject}
                        </th>
                        <th>
                            {$u.city_quyu}
                        </th>
                        <th>
                            <?php if ($u['is_laoshi_on'] == 1) { ?>
                                <span class="layui-btn layui-btn-mini">老师已接单</span>
                            <?php }else { ?>
                                <span class="layui-btn layui-btn-disabled layui-btn-mini">无人接</span>
                            <?php } ?>
                        </th>
                        <td class="td-manage">
                            <a title="更换老师" href="javascript:;" onclick="order_edit('更换老师','{:U('admin/order/index_sk_hls',array('id'=>$u['id']))}','4','','510')"class="ml-5" style="text-decoration:none"><span class="layui-btn layui-btn-mini layui-btn-warm">更换老师</span></a>

                            <a title="审核" href="javascript:;" onclick="member_del(this,{$u['id']})" style="text-decoration:none"><span class="layui-btn layui-btn-mini">审核</span></a>
                        </td>
                    </tr>
                <?php } ?>
                </tbody>
            </table>
            <style>
                .fenye{ margin-top: 20px;}
                .fenye div a,.fenye div span{display: inline-block;padding: 5px 15px;margin-right: -1px;border: 1px solid #1AA094;}
                .fenye div span{background: #1AA094;color: #fff;}
            </style>
            <div class="fenye">{$page}</div>
        </div>
        <script src="__PUBLIC__/admin/lib/layui/layui.js" charset="utf-8"></script>
        <script src="__PUBLIC__/admin/js/x-layui.js" charset="utf-8"></script>
        <script>
            layui.use(['laydate','element','laypage','layer'], function(){
                $ = layui.jquery;//jquery
              laydate = layui.laydate;//日期插件
              lement = layui.element();//面包导航
              laypage = layui.laypage;//分页
              layer = layui.layer;//弹出层

              //以上模块根据需要引入
              
            });


            //编辑
            function order_edit (title,url,id,w,h) {
                x_admin_show(title,url,w,h); 
            }

            /*订单审核*/
            function member_del(obj,id){
                layer.confirm('确认要审核吗？',function(index){
                    //发异步删除数据
                    id = id;
                    $.ajax({
                        url: "{:U('admin/order/order_shenhe')}",//请求地址
                        type: "post",//请求方式
                        dataType: "json",//返回数据类型
                        data: {id:id},//发送的参数
                        })
                        .done(function(response) {
                              if(response.error==1){
                                layer.msg(response.info ,{icon:6});
                                location.reload();
                              }else{
                                layer.msg(response.info ,{icon:5});
                              }
                          })
                        .fail(function() {
                            alert("ajxs交互失败");
                        })  
                    return false;
                });
            }
            </script>
    </body>
</html>